package com.king.netty.dubbo.customer;

import com.king.netty.dubbo.netty.NettyClient;
import com.king.netty.dubbo.publicinterface.HelloService;

/**
 * @Author king
 * @Date 2021-04-13 16:13
 */
public class ClientBootstrap {

    public static final String PROVIDER_NAME = "dubbo#";

    public static void main(String[] args) {
        // 创建一个消费者
        NettyClient customer = new NettyClient();

        // 创建代理对象
        HelloService helloService = (HelloService) customer.getBean(HelloService.class, PROVIDER_NAME);

        for(int i = 0; i < 10; ++i){
            // 通过代理对象调用服务提供者的方法
            String res = helloService.hello("你好，服务端！");
            // 输出结果
            System.out.printf("服务端回送信息=%s\n", res);
        }

    }
}
